<template>
	<view v-if="list.length!=0" class="list">
		<card v-for="(item, index) in list" :key="item.id" :item='item'></card>
	</view>
	<view v-else>
		<u-empty mode="favor">
		</u-empty>
	</view>
	<!-- 	<u-loading-page :loading="loading" loading-text="loading..."></u-loading-page> -->
	</view>
</template>

<script>
	import {
		getMyLikes
	} from '../../api/article'
	export default {
		data() {
			return {
				loading: false,
				list: [],
			}
		},
		onShow() {
			this.getList()
		},

		methods: {
			getList() {
				this.loading = true
				getMyLikes().then(res => {
					this.list = res
					this.loading = false
				}).catch(() => {
					this.loading = false
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.subject-cover {
		width: 100%;
	}

	.subject {
		margin-bottom: 20rpx;
		background-color: #FFF;
		padding: 20rpx 30rpx 30rpx;
		box-shadow: 0 8rpx 4rpx #F5F5F5;

		.title {
			font-size: 32rpx;
			font-weight: bold;
		}

		.summary {
			color: #777;
			margin: 10rpx 0;
			font-size: 24rpx;
		}

		.text {
			color: #999;
			font-size: 24rpx;
			margin-right: 40rpx;
		}
	}
</style>